package com.anXin.article.controller;


import com.anXin.article.mapper.ArticleMapper;
import com.anXin.article.service.ArticleService;
import com.anXin.article.service.SensitiveService;
import com.anXin.model.article.pojos.Article;
import com.anXin.model.article.pojos.Sensitive;
import com.anXin.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/sensitive")
public class SensitiveController {

  @Resource
    private SensitiveService sensitiveService;

  @PostMapping("/add")
    private ResponseResult add(@RequestBody String sensitives){
      return sensitiveService.add(sensitives);
  }

  @PutMapping("/update")
  private ResponseResult update(@RequestBody Sensitive sensitive){
    return sensitiveService.updatesensitive(sensitive);
  }

  @GetMapping("/list")
  private ResponseResult sensitiveList(){
    return sensitiveService.sensitiveList();
  }
  @DeleteMapping("/batchDelete")
  public ResponseResult batchDelete(@RequestParam("ids") Long[] ids){
    return sensitiveService.batchDelete(ids);
  }
}
